<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<!-- 引入bootstrap -->
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/plugin/css/bootstrap.min.css">
	<!-- 引入JQuery  bootstrap.js-->
	<script src="${pageContext.request.contextPath}/plugin/js/jquery-3.2.1.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugin/js/bootstrap.min.js"></script>
	<style type="text/css">
	body{
	   background: url(image/sm/a.jpg)repeat;
	}
	#login-box {
		/*border:1px solid #F00;*/
		padding: 35px;
		border-radius:15px;
		background: #56666B;
		color: #fff;
	}

	</style>
</head>
<body>
	<div class="container" id="top">
		<div class="row" style="margin-top: 300px; ">
			<div class="col-md-4"></div>
			<div class="col-md-4" id="login-box">
				<form class="form-horizontal" role="form" action="forget" id="from1" method="post" >
				  <div class="form-group">
				    <label for="firstname" class="col-sm-3 control-label" style="font-size: 10px">账户名</label>
				    <div class="col-sm-9">
				      <input type="text" class="form-control" id="accountName" placeholder="请输入名字" name="accountName">
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="lastname" class="col-sm-3 control-label" style="font-size: 10px">邮箱</label>
				    <div class="col-sm-9">
				      <input type="email" class="form-control" id="email" placeholder="请输入邮箱" name="email">
				    </div>
				  </div>
				  <br>
				  <div style="background:#56666B" class="modal-footer">
					<button type="button" class="btn btn-primary" style="margin-left:20px" data-dismiss="modal">取消</button>
					<button id="forgetPwd" class="btn btn-primary" >确认</button>
				  </div>
				</form>
			</div>
			<div class="col-md-4"></div>
		</div>		
	</div>
</body>
		
	<script type="text/javascript">
	$("#forgetPwd").click(function () {
        if($("#accountName").val()==''&&$("#email").val()==''){
            alert("账户、邮箱不能为空");
        }
        else if ($("#accountName").val()==''){
            alert("账户不能为空");
        }
        else if($("#email").val()==''){
            alert("邮箱不能为空");
        }
        else {
            $.ajax({
                type: "POST",
                url: "${pageContext.request.contextPath}/forget",
                data: {
                    accountName:$("#accountName").val() ,
                    email: $("#email").val()
                },
                dataType: "json",
                success: function(data) {
                	//window.location.href = "${pageContext.request.contextPath}/";
                }
        
                });
        }
    })
	
	</script>
</html>